[Unit]
Description=Mistral workflow service api
After=network.target

[Service]
Type=simple
User=mistral
Group=mistral
Environment="COMPONENTS=api,engine,executor,notifier"
Environment="API_ARGS=--log-file /var/log/mistral/mistral-api.log -b {{ ansible_default_ipv4.address }}:{{ st2_port.mistral }} -w 2 mistral.api.wsgi --graceful-timeout 10"
EnvironmentFile=-/etc/sysconfig/mistral
ExecStart=/bin/sh -c ". /opt/stackstorm/mistral/share/sysvinit/helpers; enabled_list -q api || exit 0; exec /opt/stackstorm/mistral/bin/gunicorn $API_ARGS"
PrivateTmp=true

[Install]
WantedBy=multi-user.target
